import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login', //重定向到/login
    },
    
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')

  },
  {
    path: '/3001',
    component: () => import(/* webpackChunkName: "about" */ '../views/error/3001.vue')

  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "about" */ '../views/error/404.vue')

  },

  {
    path: '/main',
    name: 'Main',
    component: () => import(/* webpackChunkName: "about" */ '../views/Main.vue'),
      children :[
       {
        path: '/users',
        name: 'Users',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/Users.vue'),
       },
       {
         path: '/welcome',
         name: 'Welcome',
         component: () => import(/* webpackChunkName: "about" */ '../views/hospital/Welcome.vue'),
       },
       {
         path: '/register',
         name: 'Register',
         component: () => import(/* webpackChunkName: "about" */ '../views/hospital/Register.vue'),
       },
       {
        path: '/doctor',
        name: 'Doctor',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/Doctor.vue'), 
       },
       {
        path: '/information',
        name: 'Information',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/Information.vue'), 
       },
       {
        path: '/doctorInfo',
        name: 'DoctorInfo',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/DoctorInfo.vue'), 
       },
       {
        path: '/history',
        name: 'History',
        component: () => import(/* webpackChunkName: "about" */ '../views/hospital/History.vue'), 
       },
       {
        path: '/map',
        name: 'Map',
        component: () => import(/* webpackChunkName: "about" */ '../views/others/Map.vue'), 
       },
       {
        path: '/manage',
        name: 'Manage',
        component: () => import(/* webpackChunkName: "about" */ '../views/hospital/Manage.vue'), 
       },
       {
        path: '/department',
        name: 'Department',
        component: () => import(/* webpackChunkName: "about" */ '../views/hospital/Department.vue'), 
       },
       {
        path: '/doctors',
        name: 'DoctorManage',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/DoctorManage.vue'), 
       },
       {
        path: '/patients',
        name: 'Patients',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/Patients.vue'), 
       },
     
     



      ]

  }
]

const router = new VueRouter({
  routes
})

export default router
